3.1.45 \(\int \frac {\cot ^2(x)}{\sqrt {1+\cot (x)}} \, dx\) [45]

3.1.45.1 Optimal result
3.1.45.2 Mathematica [C] (verified)
3.1.45.3 Rubi [A] (verified)
3.1.45.4 Maple [B] (verified)
3.1.45.5 Fricas [C] (verification not implemented)
3.1.45.6 Sympy [F]
3.1.45.7 Maxima [F]
3.1.45.8 Giac [F]
3.1.45.9 Mupad [B] (verification not implemented)

3.1.45.1 Optimal result

Integrand size = 13, antiderivative size = 214 \[ \int \frac {\cot ^2(x)}{\sqrt {1+\cot (x)}} \, dx=-\frac {1}{2} \sqrt {1+\sqrt {2}} \arctan \left (\frac {\sqrt {2 \left (1+\sqrt {2}\right )}-2 \sqrt {1+\cot (x)}}{\sqrt {2 \left (-1+\sqrt {2}\right )}}\right )+\frac {1}{2} \sqrt {1+\sqrt {2}} \arctan \left (\frac {\sqrt {2 \left (1+\sqrt {2}\right )}+2 \sqrt {1+\cot (x)}}{\sqrt {2 \left (-1+\sqrt {2}\right )}}\right )-2 \sqrt {1+\cot (x)}-\frac {\log \left (1+\sqrt {2}+\cot (x)-\sqrt {2 \left (1+\sqrt {2}\right )} \sqrt {1+\cot (x)}\right )}{4 \sqrt {1+\sqrt {2}}}+\frac {\log \left (1+\sqrt {2}+\cot (x)+\sqrt {2 \left (1+\sqrt {2}\right )} \sqrt {1+\cot (x)}\right )}{4 \sqrt {1+\sqrt {2}}} \]

output
-2*(1+cot(x))^(1/2)-1/4*ln(1+cot(x)+2^(1/2)-(1+cot(x))^(1/2)*(2+2*2^(1/2)) 
^(1/2))/(1+2^(1/2))^(1/2)+1/4*ln(1+cot(x)+2^(1/2)+(1+cot(x))^(1/2)*(2+2*2^ 
(1/2))^(1/2))/(1+2^(1/2))^(1/2)-1/2*arctan((-2*(1+cot(x))^(1/2)+(2+2*2^(1/ 
2))^(1/2))/(-2+2*2^(1/2))^(1/2))*(1+2^(1/2))^(1/2)+1/2*arctan((2*(1+cot(x) 
)^(1/2)+(2+2*2^(1/2))^(1/2))/(-2+2*2^(1/2))^(1/2))*(1+2^(1/2))^(1/2)
 
3.1.45.2 Mathematica [C] (verified)

Result contains complex when optimal does not.

Time = 0.47 (sec) , antiderivative size = 67, normalized size of antiderivative = 0.31 \[ \int \frac {\cot ^2(x)}{\sqrt {1+\cot (x)}} \, dx=\frac {1}{2} (1-i)^{3/2} \text {arctanh}\left (\frac {\sqrt {1+\cot (x)}}{\sqrt {1-i}}\right )+\frac {1}{2} (1+i)^{3/2} \text {arctanh}\left (\frac {\sqrt {1+\cot (x)}}{\sqrt {1+i}}\right )-2 \sqrt {1+\cot (x)} \]

input
Integrate[Cot[x]^2/Sqrt[1 + Cot[x]],x]
 
output
((1 - I)^(3/2)*ArcTanh[Sqrt[1 + Cot[x]]/Sqrt[1 - I]])/2 + ((1 + I)^(3/2)*A 
rcTanh[Sqrt[1 + Cot[x]]/Sqrt[1 + I]])/2 - 2*Sqrt[1 + Cot[x]]
 
3.1.45.3 Rubi [A] (verified)

Time = 0.49 (sec) , antiderivative size = 243, normalized size of antiderivative = 1.14, number of steps used = 13, number of rules used = 12, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.923, Rules used = {3042, 4026, 25, 3042, 3966, 484, 1407, 1142, 25, 1083, 217, 1103}

Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.

\(\displaystyle \int \frac {\cot ^2(x)}{\sqrt {\cot (x)+1}} \, dx\)

\(\Big \downarrow \) 3042

\(\displaystyle \int \frac {\tan \left (x+\frac {\pi }{2}\right )^2}{\sqrt {1-\tan \left (x+\frac {\pi }{2}\right )}}dx\)

\(\Big \downarrow \) 4026

\(\displaystyle \int -\frac {1}{\sqrt {\cot (x)+1}}dx-2 \sqrt {\cot (x)+1}\)

\(\Big \downarrow \) 25

\(\displaystyle -\int \frac {1}{\sqrt {\cot (x)+1}}dx-2 \sqrt {\cot (x)+1}\)

\(\Big \downarrow \) 3042

\(\displaystyle -\int \frac {1}{\sqrt {1-\tan \left (x+\frac {\pi }{2}\right )}}dx-2 \sqrt {\cot (x)+1}\)

\(\Big \downarrow \) 3966

\(\displaystyle \int \frac {1}{\sqrt {\cot (x)+1} \left (\cot ^2(x)+1\right )}d\cot (x)-2 \sqrt {\cot (x)+1}\)

\(\Big \downarrow \) 484

\(\displaystyle 2 \int \frac {1}{(\cot (x)+1)^2-2 (\cot (x)+1)+2}d\sqrt {\cot (x)+1}-2 \sqrt {\cot (x)+1}\)

\(\Big \downarrow \) 1407

\(\displaystyle 2 \left (\frac {\int \frac {\sqrt {2 \left (1+\sqrt {2}\right )}-\sqrt {\cot (x)+1}}{\cot (x)-\sqrt {2 \left (1+\sqrt {2}\right )} \sqrt {\cot (x)+1}+\sqrt {2}+1}d\sqrt {\cot (x)+1}}{4 \sqrt {1+\sqrt {2}}}+\frac {\int \frac {\sqrt {\cot (x)+1}+\sqrt {2 \left (1+\sqrt {2}\right )}}{\cot (x)+\sqrt {2 \left (1+\sqrt {2}\right )} \sqrt {\cot (x)+1}+\sqrt {2}+1}d\sqrt {\cot (x)+1}}{4 \sqrt {1+\sqrt {2}}}\right )-2 \sqrt {\cot (x)+1}\)

\(\Big \downarrow \) 1142

\(\displaystyle 2 \left (\frac {\sqrt {\frac {1}{2} \left (1+\sqrt {2}\right )} \int \frac {1}{\cot (x)-\sqrt {2 \left (1+\sqrt {2}\right )} \sqrt {\cot (x)+1}+\sqrt {2}+1}d\sqrt {\cot (x)+1}-\frac {1}{2} \int -\frac {\sqrt {2 \left (1+\sqrt {2}\right )}-2 \sqrt {\cot (x)+1}}{\cot (x)-\sqrt {2 \left (1+\sqrt {2}\right )} \sqrt {\cot (x)+1}+\sqrt {2}+1}d\sqrt {\cot (x)+1}}{4 \sqrt {1+\sqrt {2}}}+\frac {\sqrt {\frac {1}{2} \left (1+\sqrt {2}\right )} \int \frac {1}{\cot (x)+\sqrt {2 \left (1+\sqrt {2}\right )} \sqrt {\cot (x)+1}+\sqrt {2}+1}d\sqrt {\cot (x)+1}+\frac {1}{2} \int \frac {2 \sqrt {\cot (x)+1}+\sqrt {2 \left (1+\sqrt {2}\right )}}{\cot (x)+\sqrt {2 \left (1+\sqrt {2}\right )} \sqrt {\cot (x)+1}+\sqrt {2}+1}d\sqrt {\cot (x)+1}}{4 \sqrt {1+\sqrt {2}}}\right )-2 \sqrt {\cot (x)+1}\)

\(\Big \downarrow \) 25

\(\displaystyle 2 \left (\frac {\sqrt {\frac {1}{2} \left (1+\sqrt {2}\right )} \int \frac {1}{\cot (x)-\sqrt {2 \left (1+\sqrt {2}\right )} \sqrt {\cot (x)+1}+\sqrt {2}+1}d\sqrt {\cot (x)+1}+\frac {1}{2} \int \frac {\sqrt {2 \left (1+\sqrt {2}\right )}-2 \sqrt {\cot (x)+1}}{\cot (x)-\sqrt {2 \left (1+\sqrt {2}\right )} \sqrt {\cot (x)+1}+\sqrt {2}+1}d\sqrt {\cot (x)+1}}{4 \sqrt {1+\sqrt {2}}}+\frac {\sqrt {\frac {1}{2} \left (1+\sqrt {2}\right )} \int \frac {1}{\cot (x)+\sqrt {2 \left (1+\sqrt {2}\right )} \sqrt {\cot (x)+1}+\sqrt {2}+1}d\sqrt {\cot (x)+1}+\frac {1}{2} \int \frac {2 \sqrt {\cot (x)+1}+\sqrt {2 \left (1+\sqrt {2}\right )}}{\cot (x)+\sqrt {2 \left (1+\sqrt {2}\right )} \sqrt {\cot (x)+1}+\sqrt {2}+1}d\sqrt {\cot (x)+1}}{4 \sqrt {1+\sqrt {2}}}\right )-2 \sqrt {\cot (x)+1}\)

\(\Big \downarrow \) 1083

\(\displaystyle 2 \left (\frac {\frac {1}{2} \int \frac {\sqrt {2 \left (1+\sqrt {2}\right )}-2 \sqrt {\cot (x)+1}}{\cot (x)-\sqrt {2 \left (1+\sqrt {2}\right )} \sqrt {\cot (x)+1}+\sqrt {2}+1}d\sqrt {\cot (x)+1}-\sqrt {2 \left (1+\sqrt {2}\right )} \int \frac {1}{-\cot (x)+2 \left (1-\sqrt {2}\right )-1}d\left (2 \sqrt {\cot (x)+1}-\sqrt {2 \left (1+\sqrt {2}\right )}\right )}{4 \sqrt {1+\sqrt {2}}}+\frac {\frac {1}{2} \int \frac {2 \sqrt {\cot (x)+1}+\sqrt {2 \left (1+\sqrt {2}\right )}}{\cot (x)+\sqrt {2 \left (1+\sqrt {2}\right )} \sqrt {\cot (x)+1}+\sqrt {2}+1}d\sqrt {\cot (x)+1}-\sqrt {2 \left (1+\sqrt {2}\right )} \int \frac {1}{-\cot (x)+2 \left (1-\sqrt {2}\right )-1}d\left (2 \sqrt {\cot (x)+1}+\sqrt {2 \left (1+\sqrt {2}\right )}\right )}{4 \sqrt {1+\sqrt {2}}}\right )-2 \sqrt {\cot (x)+1}\)

\(\Big \downarrow \) 217

\(\displaystyle 2 \left (\frac {\frac {1}{2} \int \frac {\sqrt {2 \left (1+\sqrt {2}\right )}-2 \sqrt {\cot (x)+1}}{\cot (x)-\sqrt {2 \left (1+\sqrt {2}\right )} \sqrt {\cot (x)+1}+\sqrt {2}+1}d\sqrt {\cot (x)+1}+\sqrt {\frac {1+\sqrt {2}}{\sqrt {2}-1}} \arctan \left (\frac {2 \sqrt {\cot (x)+1}-\sqrt {2 \left (1+\sqrt {2}\right )}}{\sqrt {2 \left (\sqrt {2}-1\right )}}\right )}{4 \sqrt {1+\sqrt {2}}}+\frac {\frac {1}{2} \int \frac {2 \sqrt {\cot (x)+1}+\sqrt {2 \left (1+\sqrt {2}\right )}}{\cot (x)+\sqrt {2 \left (1+\sqrt {2}\right )} \sqrt {\cot (x)+1}+\sqrt {2}+1}d\sqrt {\cot (x)+1}+\sqrt {\frac {1+\sqrt {2}}{\sqrt {2}-1}} \arctan \left (\frac {2 \sqrt {\cot (x)+1}+\sqrt {2 \left (1+\sqrt {2}\right )}}{\sqrt {2 \left (\sqrt {2}-1\right )}}\right )}{4 \sqrt {1+\sqrt {2}}}\right )-2 \sqrt {\cot (x)+1}\)

\(\Big \downarrow \) 1103

\(\displaystyle 2 \left (\frac {\sqrt {\frac {1+\sqrt {2}}{\sqrt {2}-1}} \arctan \left (\frac {2 \sqrt {\cot (x)+1}-\sqrt {2 \left (1+\sqrt {2}\right )}}{\sqrt {2 \left (\sqrt {2}-1\right )}}\right )-\frac {1}{2} \log \left (\cot (x)-\sqrt {2 \left (1+\sqrt {2}\right )} \sqrt {\cot (x)+1}+\sqrt {2}+1\right )}{4 \sqrt {1+\sqrt {2}}}+\frac {\sqrt {\frac {1+\sqrt {2}}{\sqrt {2}-1}} \arctan \left (\frac {2 \sqrt {\cot (x)+1}+\sqrt {2 \left (1+\sqrt {2}\right )}}{\sqrt {2 \left (\sqrt {2}-1\right )}}\right )+\frac {1}{2} \log \left (\cot (x)+\sqrt {2 \left (1+\sqrt {2}\right )} \sqrt {\cot (x)+1}+\sqrt {2}+1\right )}{4 \sqrt {1+\sqrt {2}}}\right )-2 \sqrt {\cot (x)+1}\)

input
Int[Cot[x]^2/Sqrt[1 + Cot[x]],x]
 
output
-2*Sqrt[1 + Cot[x]] + 2*((Sqrt[(1 + Sqrt[2])/(-1 + Sqrt[2])]*ArcTan[(-Sqrt 
[2*(1 + Sqrt[2])] + 2*Sqrt[1 + Cot[x]])/Sqrt[2*(-1 + Sqrt[2])]] - Log[1 + 
Sqrt[2] + Cot[x] - Sqrt[2*(1 + Sqrt[2])]*Sqrt[1 + Cot[x]]]/2)/(4*Sqrt[1 + 
Sqrt[2]]) + (Sqrt[(1 + Sqrt[2])/(-1 + Sqrt[2])]*ArcTan[(Sqrt[2*(1 + Sqrt[2 
])] + 2*Sqrt[1 + Cot[x]])/Sqrt[2*(-1 + Sqrt[2])]] + Log[1 + Sqrt[2] + Cot[ 
x] + Sqrt[2*(1 + Sqrt[2])]*Sqrt[1 + Cot[x]]]/2)/(4*Sqrt[1 + Sqrt[2]]))
 

3.1.45.3.1 Defintions of rubi rules used

rule 25
Int[-(Fx_), x_Symbol] :> Simp[Identity[-1]   Int[Fx, x], x]
 

rule 217
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[-b, 2])^( 
-1))*ArcTan[Rt[-b, 2]*(x/Rt[-a, 2])], x] /; FreeQ[{a, b}, x] && PosQ[a/b] & 
& (LtQ[a, 0] || LtQ[b, 0])
 

rule 484
Int[1/(Sqrt[(c_) + (d_.)*(x_)]*((a_) + (b_.)*(x_)^2)), x_Symbol] :> Simp[2* 
d   Subst[Int[1/(b*c^2 + a*d^2 - 2*b*c*x^2 + b*x^4), x], x, Sqrt[c + d*x]], 
 x] /; FreeQ[{a, b, c, d}, x]
 

rule 1083
Int[((a_) + (b_.)*(x_) + (c_.)*(x_)^2)^(-1), x_Symbol] :> Simp[-2   Subst[I 
nt[1/Simp[b^2 - 4*a*c - x^2, x], x], x, b + 2*c*x], x] /; FreeQ[{a, b, c}, 
x]
 

rule 1103
Int[((d_) + (e_.)*(x_))/((a_.) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> S 
imp[d*(Log[RemoveContent[a + b*x + c*x^2, x]]/b), x] /; FreeQ[{a, b, c, d, 
e}, x] && EqQ[2*c*d - b*e, 0]
 

rule 1142
Int[((d_.) + (e_.)*(x_))/((a_) + (b_.)*(x_) + (c_.)*(x_)^2), x_Symbol] :> S 
imp[(2*c*d - b*e)/(2*c)   Int[1/(a + b*x + c*x^2), x], x] + Simp[e/(2*c) 
Int[(b + 2*c*x)/(a + b*x + c*x^2), x], x] /; FreeQ[{a, b, c, d, e}, x]
 

rule 1407
Int[((a_) + (b_.)*(x_)^2 + (c_.)*(x_)^4)^(-1), x_Symbol] :> With[{q = Rt[a/ 
c, 2]}, With[{r = Rt[2*q - b/c, 2]}, Simp[1/(2*c*q*r)   Int[(r - x)/(q - r* 
x + x^2), x], x] + Simp[1/(2*c*q*r)   Int[(r + x)/(q + r*x + x^2), x], x]]] 
 /; FreeQ[{a, b, c}, x] && NeQ[b^2 - 4*a*c, 0] && NegQ[b^2 - 4*a*c]
 

rule 3042
Int[u_, x_Symbol] :> Int[DeactivateTrig[u, x], x] /; FunctionOfTrigOfLinear 
Q[u, x]
 

rule 3966
Int[((a_) + (b_.)*tan[(c_.) + (d_.)*(x_)])^(n_), x_Symbol] :> Simp[b/d   Su 
bst[Int[(a + x)^n/(b^2 + x^2), x], x, b*Tan[c + d*x]], x] /; FreeQ[{a, b, c 
, d, n}, x] && NeQ[a^2 + b^2, 0]
 

rule 4026
Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + 
 (f_.)*(x_)])^2, x_Symbol] :> Simp[d^2*((a + b*Tan[e + f*x])^(m + 1)/(b*f*( 
m + 1))), x] + Int[(a + b*Tan[e + f*x])^m*Simp[c^2 - d^2 + 2*c*d*Tan[e + f* 
x], x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b*c - a*d, 0] &&  !LeQ 
[m, -1] &&  !(EqQ[m, 2] && EqQ[a, 0])
 
3.1.45.4 Maple [B] (verified)

Leaf count of result is larger than twice the leaf count of optimal. \(441\) vs. \(2(152)=304\).

Time = 0.04 (sec) , antiderivative size = 442, normalized size of antiderivative = 2.07

method result size
derivativedivides \(-2 \sqrt {1+\cot \left (x \right )}-\frac {\sqrt {2+2 \sqrt {2}}\, \ln \left (1+\cot \left (x \right )+\sqrt {2}-\sqrt {1+\cot \left (x \right )}\, \sqrt {2+2 \sqrt {2}}\right )}{4}+\frac {\sqrt {2+2 \sqrt {2}}\, \sqrt {2}\, \ln \left (1+\cot \left (x \right )+\sqrt {2}-\sqrt {1+\cot \left (x \right )}\, \sqrt {2+2 \sqrt {2}}\right )}{8}+\frac {\sqrt {2}\, \left (2+2 \sqrt {2}\right ) \arctan \left (\frac {2 \sqrt {1+\cot \left (x \right )}-\sqrt {2+2 \sqrt {2}}}{\sqrt {-2+2 \sqrt {2}}}\right )}{4 \sqrt {-2+2 \sqrt {2}}}-\frac {\left (2+2 \sqrt {2}\right ) \arctan \left (\frac {2 \sqrt {1+\cot \left (x \right )}-\sqrt {2+2 \sqrt {2}}}{\sqrt {-2+2 \sqrt {2}}}\right )}{2 \sqrt {-2+2 \sqrt {2}}}+\frac {\arctan \left (\frac {2 \sqrt {1+\cot \left (x \right )}-\sqrt {2+2 \sqrt {2}}}{\sqrt {-2+2 \sqrt {2}}}\right ) \sqrt {2}}{\sqrt {-2+2 \sqrt {2}}}+\frac {\sqrt {2+2 \sqrt {2}}\, \ln \left (1+\cot \left (x \right )+\sqrt {2}+\sqrt {1+\cot \left (x \right )}\, \sqrt {2+2 \sqrt {2}}\right )}{4}-\frac {\sqrt {2+2 \sqrt {2}}\, \sqrt {2}\, \ln \left (1+\cot \left (x \right )+\sqrt {2}+\sqrt {1+\cot \left (x \right )}\, \sqrt {2+2 \sqrt {2}}\right )}{8}+\frac {\sqrt {2}\, \left (2+2 \sqrt {2}\right ) \arctan \left (\frac {2 \sqrt {1+\cot \left (x \right )}+\sqrt {2+2 \sqrt {2}}}{\sqrt {-2+2 \sqrt {2}}}\right )}{4 \sqrt {-2+2 \sqrt {2}}}-\frac {\left (2+2 \sqrt {2}\right ) \arctan \left (\frac {2 \sqrt {1+\cot \left (x \right )}+\sqrt {2+2 \sqrt {2}}}{\sqrt {-2+2 \sqrt {2}}}\right )}{2 \sqrt {-2+2 \sqrt {2}}}+\frac {\arctan \left (\frac {2 \sqrt {1+\cot \left (x \right )}+\sqrt {2+2 \sqrt {2}}}{\sqrt {-2+2 \sqrt {2}}}\right ) \sqrt {2}}{\sqrt {-2+2 \sqrt {2}}}\) \(442\)
default \(-2 \sqrt {1+\cot \left (x \right )}-\frac {\sqrt {2+2 \sqrt {2}}\, \ln \left (1+\cot \left (x \right )+\sqrt {2}-\sqrt {1+\cot \left (x \right )}\, \sqrt {2+2 \sqrt {2}}\right )}{4}+\frac {\sqrt {2+2 \sqrt {2}}\, \sqrt {2}\, \ln \left (1+\cot \left (x \right )+\sqrt {2}-\sqrt {1+\cot \left (x \right )}\, \sqrt {2+2 \sqrt {2}}\right )}{8}+\frac {\sqrt {2}\, \left (2+2 \sqrt {2}\right ) \arctan \left (\frac {2 \sqrt {1+\cot \left (x \right )}-\sqrt {2+2 \sqrt {2}}}{\sqrt {-2+2 \sqrt {2}}}\right )}{4 \sqrt {-2+2 \sqrt {2}}}-\frac {\left (2+2 \sqrt {2}\right ) \arctan \left (\frac {2 \sqrt {1+\cot \left (x \right )}-\sqrt {2+2 \sqrt {2}}}{\sqrt {-2+2 \sqrt {2}}}\right )}{2 \sqrt {-2+2 \sqrt {2}}}+\frac {\arctan \left (\frac {2 \sqrt {1+\cot \left (x \right )}-\sqrt {2+2 \sqrt {2}}}{\sqrt {-2+2 \sqrt {2}}}\right ) \sqrt {2}}{\sqrt {-2+2 \sqrt {2}}}+\frac {\sqrt {2+2 \sqrt {2}}\, \ln \left (1+\cot \left (x \right )+\sqrt {2}+\sqrt {1+\cot \left (x \right )}\, \sqrt {2+2 \sqrt {2}}\right )}{4}-\frac {\sqrt {2+2 \sqrt {2}}\, \sqrt {2}\, \ln \left (1+\cot \left (x \right )+\sqrt {2}+\sqrt {1+\cot \left (x \right )}\, \sqrt {2+2 \sqrt {2}}\right )}{8}+\frac {\sqrt {2}\, \left (2+2 \sqrt {2}\right ) \arctan \left (\frac {2 \sqrt {1+\cot \left (x \right )}+\sqrt {2+2 \sqrt {2}}}{\sqrt {-2+2 \sqrt {2}}}\right )}{4 \sqrt {-2+2 \sqrt {2}}}-\frac {\left (2+2 \sqrt {2}\right ) \arctan \left (\frac {2 \sqrt {1+\cot \left (x \right )}+\sqrt {2+2 \sqrt {2}}}{\sqrt {-2+2 \sqrt {2}}}\right )}{2 \sqrt {-2+2 \sqrt {2}}}+\frac {\arctan \left (\frac {2 \sqrt {1+\cot \left (x \right )}+\sqrt {2+2 \sqrt {2}}}{\sqrt {-2+2 \sqrt {2}}}\right ) \sqrt {2}}{\sqrt {-2+2 \sqrt {2}}}\) \(442\)

input
int(cot(x)^2/(1+cot(x))^(1/2),x,method=_RETURNVERBOSE)
 
output
-2*(1+cot(x))^(1/2)-1/4*(2+2*2^(1/2))^(1/2)*ln(1+cot(x)+2^(1/2)-(1+cot(x)) 
^(1/2)*(2+2*2^(1/2))^(1/2))+1/8*(2+2*2^(1/2))^(1/2)*2^(1/2)*ln(1+cot(x)+2^ 
(1/2)-(1+cot(x))^(1/2)*(2+2*2^(1/2))^(1/2))+1/4*2^(1/2)*(2+2*2^(1/2))/(-2+ 
2*2^(1/2))^(1/2)*arctan((2*(1+cot(x))^(1/2)-(2+2*2^(1/2))^(1/2))/(-2+2*2^( 
1/2))^(1/2))-1/2*(2+2*2^(1/2))/(-2+2*2^(1/2))^(1/2)*arctan((2*(1+cot(x))^( 
1/2)-(2+2*2^(1/2))^(1/2))/(-2+2*2^(1/2))^(1/2))+1/(-2+2*2^(1/2))^(1/2)*arc 
tan((2*(1+cot(x))^(1/2)-(2+2*2^(1/2))^(1/2))/(-2+2*2^(1/2))^(1/2))*2^(1/2) 
+1/4*(2+2*2^(1/2))^(1/2)*ln(1+cot(x)+2^(1/2)+(1+cot(x))^(1/2)*(2+2*2^(1/2) 
)^(1/2))-1/8*(2+2*2^(1/2))^(1/2)*2^(1/2)*ln(1+cot(x)+2^(1/2)+(1+cot(x))^(1 
/2)*(2+2*2^(1/2))^(1/2))+1/4*2^(1/2)*(2+2*2^(1/2))/(-2+2*2^(1/2))^(1/2)*ar 
ctan((2*(1+cot(x))^(1/2)+(2+2*2^(1/2))^(1/2))/(-2+2*2^(1/2))^(1/2))-1/2*(2 
+2*2^(1/2))/(-2+2*2^(1/2))^(1/2)*arctan((2*(1+cot(x))^(1/2)+(2+2*2^(1/2))^ 
(1/2))/(-2+2*2^(1/2))^(1/2))+1/(-2+2*2^(1/2))^(1/2)*arctan((2*(1+cot(x))^( 
1/2)+(2+2*2^(1/2))^(1/2))/(-2+2*2^(1/2))^(1/2))*2^(1/2)
 
3.1.45.5 Fricas [C] (verification not implemented)

Result contains complex when optimal does not.

Time = 0.29 (sec) , antiderivative size = 178, normalized size of antiderivative = 0.83 \[ \int \frac {\cot ^2(x)}{\sqrt {1+\cot (x)}} \, dx=\frac {1}{4} \, \sqrt {2} \sqrt {i - 1} \log \left (-\left (i - 1\right ) \, \sqrt {2} \sqrt {i - 1} + 2 \, \sqrt {\frac {\cos \left (2 \, x\right ) + \sin \left (2 \, x\right ) + 1}{\sin \left (2 \, x\right )}}\right ) - \frac {1}{4} \, \sqrt {2} \sqrt {i - 1} \log \left (\left (i - 1\right ) \, \sqrt {2} \sqrt {i - 1} + 2 \, \sqrt {\frac {\cos \left (2 \, x\right ) + \sin \left (2 \, x\right ) + 1}{\sin \left (2 \, x\right )}}\right ) + \frac {1}{4} \, \sqrt {2} \sqrt {-i - 1} \log \left (\left (i + 1\right ) \, \sqrt {2} \sqrt {-i - 1} + 2 \, \sqrt {\frac {\cos \left (2 \, x\right ) + \sin \left (2 \, x\right ) + 1}{\sin \left (2 \, x\right )}}\right ) - \frac {1}{4} \, \sqrt {2} \sqrt {-i - 1} \log \left (-\left (i + 1\right ) \, \sqrt {2} \sqrt {-i - 1} + 2 \, \sqrt {\frac {\cos \left (2 \, x\right ) + \sin \left (2 \, x\right ) + 1}{\sin \left (2 \, x\right )}}\right ) - 2 \, \sqrt {\frac {\cos \left (2 \, x\right ) + \sin \left (2 \, x\right ) + 1}{\sin \left (2 \, x\right )}} \]

input
integrate(cot(x)^2/(1+cot(x))^(1/2),x, algorithm="fricas")
 
output
1/4*sqrt(2)*sqrt(I - 1)*log(-(I - 1)*sqrt(2)*sqrt(I - 1) + 2*sqrt((cos(2*x 
) + sin(2*x) + 1)/sin(2*x))) - 1/4*sqrt(2)*sqrt(I - 1)*log((I - 1)*sqrt(2) 
*sqrt(I - 1) + 2*sqrt((cos(2*x) + sin(2*x) + 1)/sin(2*x))) + 1/4*sqrt(2)*s 
qrt(-I - 1)*log((I + 1)*sqrt(2)*sqrt(-I - 1) + 2*sqrt((cos(2*x) + sin(2*x) 
 + 1)/sin(2*x))) - 1/4*sqrt(2)*sqrt(-I - 1)*log(-(I + 1)*sqrt(2)*sqrt(-I - 
 1) + 2*sqrt((cos(2*x) + sin(2*x) + 1)/sin(2*x))) - 2*sqrt((cos(2*x) + sin 
(2*x) + 1)/sin(2*x))
 
3.1.45.6 Sympy [F]

\[ \int \frac {\cot ^2(x)}{\sqrt {1+\cot (x)}} \, dx=\int \frac {\cot ^{2}{\left (x \right )}}{\sqrt {\cot {\left (x \right )} + 1}}\, dx \]

input
integrate(cot(x)**2/(1+cot(x))**(1/2),x)
 
output
Integral(cot(x)**2/sqrt(cot(x) + 1), x)
 
3.1.45.7 Maxima [F]

\[ \int \frac {\cot ^2(x)}{\sqrt {1+\cot (x)}} \, dx=\int { \frac {\cot \left (x\right )^{2}}{\sqrt {\cot \left (x\right ) + 1}} \,d x } \]

input
integrate(cot(x)^2/(1+cot(x))^(1/2),x, algorithm="maxima")
 
output
integrate(cot(x)^2/sqrt(cot(x) + 1), x)
 
3.1.45.8 Giac [F]

\[ \int \frac {\cot ^2(x)}{\sqrt {1+\cot (x)}} \, dx=\int { \frac {\cot \left (x\right )^{2}}{\sqrt {\cot \left (x\right ) + 1}} \,d x } \]

input
integrate(cot(x)^2/(1+cot(x))^(1/2),x, algorithm="giac")
 
output
integrate(cot(x)^2/sqrt(cot(x) + 1), x)
 
3.1.45.9 Mupad [B] (verification not implemented)

Time = 12.46 (sec) , antiderivative size = 238, normalized size of antiderivative = 1.11 \[ \int \frac {\cot ^2(x)}{\sqrt {1+\cot (x)}} \, dx=\mathrm {atanh}\left (\frac {16\,\sqrt {2}\,\sqrt {-\frac {\sqrt {2}}{16}-\frac {1}{16}}\,\sqrt {\mathrm {cot}\left (x\right )+1}}{128\,\sqrt {\frac {\sqrt {2}}{16}-\frac {1}{16}}\,\sqrt {-\frac {\sqrt {2}}{16}-\frac {1}{16}}-8}-\frac {16\,\sqrt {2}\,\sqrt {\frac {\sqrt {2}}{16}-\frac {1}{16}}\,\sqrt {\mathrm {cot}\left (x\right )+1}}{128\,\sqrt {\frac {\sqrt {2}}{16}-\frac {1}{16}}\,\sqrt {-\frac {\sqrt {2}}{16}-\frac {1}{16}}-8}\right )\,\left (2\,\sqrt {-\frac {\sqrt {2}}{16}-\frac {1}{16}}+2\,\sqrt {\frac {\sqrt {2}}{16}-\frac {1}{16}}\right )-\mathrm {atanh}\left (\frac {16\,\sqrt {2}\,\sqrt {-\frac {\sqrt {2}}{16}-\frac {1}{16}}\,\sqrt {\mathrm {cot}\left (x\right )+1}}{128\,\sqrt {\frac {\sqrt {2}}{16}-\frac {1}{16}}\,\sqrt {-\frac {\sqrt {2}}{16}-\frac {1}{16}}+8}+\frac {16\,\sqrt {2}\,\sqrt {\frac {\sqrt {2}}{16}-\frac {1}{16}}\,\sqrt {\mathrm {cot}\left (x\right )+1}}{128\,\sqrt {\frac {\sqrt {2}}{16}-\frac {1}{16}}\,\sqrt {-\frac {\sqrt {2}}{16}-\frac {1}{16}}+8}\right )\,\left (2\,\sqrt {-\frac {\sqrt {2}}{16}-\frac {1}{16}}-2\,\sqrt {\frac {\sqrt {2}}{16}-\frac {1}{16}}\right )-2\,\sqrt {\mathrm {cot}\left (x\right )+1} \]

input
int(cot(x)^2/(cot(x) + 1)^(1/2),x)
 
output
atanh((16*2^(1/2)*(- 2^(1/2)/16 - 1/16)^(1/2)*(cot(x) + 1)^(1/2))/(128*(2^ 
(1/2)/16 - 1/16)^(1/2)*(- 2^(1/2)/16 - 1/16)^(1/2) - 8) - (16*2^(1/2)*(2^( 
1/2)/16 - 1/16)^(1/2)*(cot(x) + 1)^(1/2))/(128*(2^(1/2)/16 - 1/16)^(1/2)*( 
- 2^(1/2)/16 - 1/16)^(1/2) - 8))*(2*(- 2^(1/2)/16 - 1/16)^(1/2) + 2*(2^(1/ 
2)/16 - 1/16)^(1/2)) - atanh((16*2^(1/2)*(- 2^(1/2)/16 - 1/16)^(1/2)*(cot( 
x) + 1)^(1/2))/(128*(2^(1/2)/16 - 1/16)^(1/2)*(- 2^(1/2)/16 - 1/16)^(1/2) 
+ 8) + (16*2^(1/2)*(2^(1/2)/16 - 1/16)^(1/2)*(cot(x) + 1)^(1/2))/(128*(2^( 
1/2)/16 - 1/16)^(1/2)*(- 2^(1/2)/16 - 1/16)^(1/2) + 8))*(2*(- 2^(1/2)/16 - 
 1/16)^(1/2) - 2*(2^(1/2)/16 - 1/16)^(1/2)) - 2*(cot(x) + 1)^(1/2)